<template>
  <div class="comment">
    <createComments></createComments>
  </div>
</template>
<script>
import createComments from '@/components/createComments'
export default {
  data(){
    return{
      value:'',
      checked:true,
      userInfo:[],
    }
  },
  components:{
    createComments,
  },
  mounted(){
    let name = this.$route.query.incident == 'deliver'?"转交":"加签"
    this.$dd.ready(()=>{
      this.$dd.biz.navigation.setTitle({
        title : name + '给' + JSON.parse(this.$route.query.user_list)[0].alias,//控制标题文本，空字符串表示显示默认文本
        onSuccess : ()=> {
           
        },
        onFail : ()=> {}
      });
    })
  },
  methods:{
    submit(data){
      data.target_username = JSON.parse(this.$route.query.user_list)[0].username
      console.log(data)
      if(this.$route.query.incident == 'deliver'){
        this.$store.dispatch('api_post_deliver',data).then(res=>{
          if(res.status == 200){
            this.$router.go(-1)
            this.$toast.success('转交成功');
          }
        }).catch(err=>{
          console.log(err)
          this.$toast.fail('转交失败，请稍后重试');
        })
      }else{
        this.$store.dispatch('api_post_add_node',data).then(res=>{
          if(res.status == 200){
            this.$router.go(-1)
            this.$toast.success('加签成功');
          }
        }).catch(err=>{
          console.log(err)
          this.$toast.fail('加签失败，请稍后重试');
        })
      }
    }
  },

}
</script>

<style lang="less" scoped >
.comment{
  position: absolute;
  top:0;
  bottom:0;
  width: 100%;
  background: #fff;
}
</style>